﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=1">
    <meta name="format-detection" content="telephone=no">
    <meta charset="UTF-8">
    <title>Vue模版</title>
    <link href="../css/bootstrap.css"/>
    <link href="../css/bootstrap-theme.css"/>

    <style>
        .blue{
            color: blue;
        }
        .red{
            color: red;
        }
    </style>
</head>
<body>
    <h1>Vue用于复制粘贴的源文件</h1><br/>

    <div id="app">
        <ul>
            <li v-for="v in todos">
                <span :class="v.status?'blue':'red'">{{v.title}}</span>
                <button v-if="v.status" @click="change(v,false)">删除</button>
                <button v-if="!v.status" @click="change(v,true)">恢复</button>
            </li>
        </ul>
    </div>
<script src="../js/jquery-2.2.0.min.js"></script>
<script src="../js/vue-2.5.16.js"></script>
<script src="../node_modules/axios/dist/axios.js"></script>
<script src="../node_modules/lodash/lodash.js"></script>

<script>
    var app = new Vue({
        el:'#app',
        methods:{
            change(e,status){
                e.status = status;
            }
        },
        data:{
            todos:[
                {title:'节点1',status:true},
                {title:'节点2',status:true}
            ]
        }
    });
</script>

</body>
</html>